<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>ChangeCurrentElement</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">ChangeCurrentElement()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#3A3966"><b>ChangeCurrentElement</b></font>(List(), *NewElement)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Changes the current element of the specified list to the given new element. 
This function is very useful if you want to "remember" an element, and restore it after 
performing other processing. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>List()</i></td>
<td width="90%"> 
 
The name of the list, created with the <a href="../reference/newlist.html">NewList</a> function. 
You must include the brackets after the list name. 

 

</td></tr>
<tr><td><i>*NewElement</i></td>
<td> 
 
The new element to set as the current element for the list. 
The element must be a <a href="../reference/memory.html">pointer</a> to another element which exists in this list. 
You should get this address by using the @ operator on the list name and not through 
any other method. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  *Old_Element = @mylist()   <font color="#3A3966">; Get the address of the current element</font>
  
<font color="#3A3966">  ResetList</font>(<font color="#3A3966">mylist</font>())        <font color="#3A3966">; Perform a search for all elements named</font>
  <b><font color="#3A3966">While</font></b> <font color="#3A3966">NextElement</font>(<font color="#3A3966">mylist</font>())   <font color="#3A3966">; "John" and change them to "J" </font>
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">mylist</font>()\name = "John"
<font color="#3A3966">      mylist</font>()\name = "J"     
    <b><font color="#3A3966">EndIf</font></b> 
  <b><font color="#3A3966">Wend</font></b>     
  
<font color="#3A3966">  ChangeCurrentElement</font>(<font color="#3A3966">mylist</font>(), *Old_Element) <font color="#3A3966">; Restore previous current element (from before the search)</font>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="selectelement.html">SelectElement()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=addelement.html>AddElement()</a> - <a href="index.html">List Index</a> - <a href="clearlist.html">ClearList()</a> -&gt;<br><br>

</body></html>